package com.atguigu.spzx.product.client;

import com.atguigu.spzx.model.entity.cart.CartItem;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.product.client.fallback.ServiceProductClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
//fallback:配置降级类
@FeignClient(value = "service-product" , fallback = ServiceProductClientFallback.class) //openfeign会自动使用service-product到注册中心负载均衡获取一个服务地址+端口
public interface ServiceProductClient {
    @GetMapping("/api/product/sku/{skuId}")
    public Result<ProductSku> getSkuBySkuId(@PathVariable("skuId")Long skuId);
}
